$(function () {
	// alert($(window).height())
	var index=2,
		index1=0;
	$("#top_video").height($(window).height())
	$("#oVideo").css("marginTop",-$("#oVideo").height()/2);
	$("#oVideo").css("marginLeft",-$("#oVideo").width()/2);
	$(".starschools_a").height($(".starschools_a").width()*1.42)
	if($(window).width()<970){
		$("#find_announces>a").height($("#find_announces>a").width()*0.676)
	}else {
		$("#find_announces>a").height(146)
	}
	if($(window).width()<970){
		$("#news>a").height($("#news>a").width()*0.676)
	}else {
		$("#news>a").height(146)
	}
	if($(window).width()<1000){
		$("#announces").height($("#announces").width()/2.4)
	}else {
		$("#announces").height(400)
	}
	$(window).on("resize",function(){
		$("#top_video").height($(window).height())
		$("#oVideo").css("marginTop",-$("#oVideo").height()/2);
		$("#oVideo").css("marginLeft",-$("#oVideo").width()/2);
		if($(window).width()<1000){
			$("#announces").height($("#announces").width()/2.4)
		}else {
			$("#announces").height(400)
		}
		if($(window).width()<970){
			$("#find_announces>a").height($("#find_announces>a").width()*0.676)
		}else {
			$("#find_announces>a").height(146)
		}
		if($(window).width()<970){
			$("#news>a").height($("#news>a").width()*0.676)
		}else {
			$("#news>a").height(146)
		}
	})
	$(window).on("scroll",function(){
		var scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop;
		if(scrollTop>10){
			$("#top_fixed").css({"paddingTop":0,"background":"black"});
		}else {
			$("#top_fixed").css({"paddingTop":20,"background":"none"});
		}
		$("#downdrop").css("bottom",20-(scrollTop/3));
	})
	$(".somestardiv").on("mouseenter",function(){
		$(".somestardiv").eq(index).removeClass("activesomestar");
		$(this).addClass("activesomestar");
		index=$(this).index()
	})
	$("#findstars>div").on("mouseenter",function(){
		$("#findstars>div").eq(index1).removeClass("width400");
		$(this).addClass("width400")
		index1=$(this).index()
	});
	console.log($(document).scrollTop())
	var oScrollTop=$(document).scrollTop();
	$(document).on("mousewheel", function (e) {
    	e.preventDefault()
	    var delta=e.originalEvent.wheelDelta;
	    if(delta>0){
	    	if(oScrollTop>=120){
	    		oScrollTop=oScrollTop-delta;
	    	}
	    }else {
	    	if(oScrollTop>=0){
	    		oScrollTop=oScrollTop-delta;
	    	}
	    }
	    $("body").stop().animate({scrollTop:oScrollTop},400)

	    console.log(oScrollTop);

	    return false;

	});
})